<% if @users.blank? %>
  <p class="error">There are no users added yet.</p>
<% else %>
  <table>
    <thead>
      <tr>
        <th>Login</th>
        <th>Email</th>
      </tr>
    </thead>
    <tbody>
      <% @users.each do |user| %>
        <%if self.current_user.can('view:user', user) %>
          <tr class="<%= cycle('odd', 'even') %>">
            <td><%=h user.login %></td>
            <td><%=h user.email %></td>
            <td class="last">
		      <a href="/users/<%=user.id%>/edit"><img src="images/icons/pencil.png"></a>
            </td>
          </tr>
        <% end %>
      <% end %>
	  <%= will_paginate @users %>
    </tbody>
  </table>

<% end %>
<%if self.current_user.can('create:user', self.current_user) %>
<p><%= link_to 'Add new user', new_user_path %></p>
<%end%>